package com.oocl.o2o.client.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@GenericGenerator(name = "food_type_id_generator", strategy = "uuid")
public class FoodType {
	@Id
	@GeneratedValue(generator="food_type_id_generator")
	@Column(columnDefinition="char(32)")
	private String id;
	@Column(name="type_name")
	private String typeName;
	
	@JsonIgnore
	@OneToMany(mappedBy="foodType")
	private List<Food> foods = new ArrayList<Food>();


	public FoodType() {
	
	}

	public FoodType(String typeName) {
		this.typeName = typeName;
		this.foods = foods;
	}


	public String getId() {
		return id;
	}


	public String getTypeName() {
		return typeName;
	}


	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}


	public List<Food> getFoods() {
		return foods;
	}


	public void setFoods(List<Food> foods) {
		this.foods = foods;
	}

	@Override
	public String toString() {
		return "FoodType [id=" + id + ", typeName=" + typeName + "]";
	}
	
	
}

